package com.example.demo.controller

import com.example.demo.service.BoardService
import com.example.demo.service.DoorService
import com.example.demo.utils.MResult
import com.example.demo.vo.DoorPatientListVo
import com.example.demo.vo.PatientVo
import com.example.demo.vo.board.ScheduleVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiSort
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController


@RestController
@RequestMapping("/medical")
@Api(tags = ["门口屏接口"])
@ApiSort(value = 4)
class DoorController @Autowired constructor(
        private val mDoorService: DoorService
) {

    @ApiOperation(value = "门口屏屏首页")
    @PostMapping("/getDoorPatient")
    fun getDoorPatient(roomCode: String): MResult<DoorPatientListVo> {
        mDoorService.getDoorPatientList(roomCode)?.let {
            return MResult<DoorPatientListVo>().result(it)
        } ?: return MResult<DoorPatientListVo>().nullData()
    }


}